package com.huineta.business.common.security.captcha;

import com.huineta.business.common.constant.ControllerConstant;
import com.huineta.business.common.web.domain.Result;
import com.huineta.business.common.web.interceptor.annotation.RateLimit;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import com.huineta.business.common.web.domain.ResultController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

/**
 * Author:       Dmm Lee< bclassline@gmail.com >
 * Date:         2022/11/28
 * Description:  Captcha Rest 服务
 */
@Api(tags = {"验证"})
@RestController
@RequestMapping(ControllerConstant.PREFIX + "captcha")
public class SecurityCaptchaRest extends ResultController {

    @Resource
    private SecurityCaptchaService customCaptchaService;

    /**
     * Captcha 生成
     * */
    @RateLimit
    @GetMapping("create")
    @ApiOperation(value = "创建验证码")
    public Result createCaptcha(){
        return success(customCaptchaService.createCaptcha());
    }

}
